// functionPage/pages/review/reviewList/reviewList.js
import Http from '../../../../utils/http.js';
import { scrollToLeftEnd } from '../../../../utils/behavior';
const http = new Http();
const app = getApp();
Page({
    behaviors: [scrollToLeftEnd],
    /**
     * 页面的初始数据
     */
    data: {
        current: 0,
        checkInCnt: 0,
        enterCnt: 0,
        exeperienceCnt: 0,
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {},

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.getCountList();
    },
    //切换nav
    changeNav(e) {
        this.setData({
            current: e.currentTarget.dataset.index,
        });
    },
    //swiper切换
    swiperChange(e) {
        this.setData({
            current: e.detail.current,
        });
    },
    //录入审核刷新
    refreshInput() {
        this.selectComponent('#refresh-input').refresh();
    },
    //补卡审核
    // refreshCheckIn() {
    //     this.selectComponent('#refresh-checkIn').refresh();
    // },
    //经验审核
    refreshExperience() {
        this.selectComponent('#refresh-experience').refresh();
    },
    // 审核后刷新
    getCountList() {
        let _that = this;
        let data = {
            authId: app.globalData.authId,
        };
        http.getRequest(`cjMap/getVerifyTypeCountList`, data).then((res) => {
            if (res.status == 0) {
                _that.setData({
                    checkInCnt: res.checkInCnt.unVerifyCnt,
                    enterCnt: res.enterCnt.unVerifyCnt,
                    exeperienceCnt: res.exeperienceCnt.unVerifyCnt,
                });
            }
        });
    },
});
